package com.kinghunt.misp.web.controller.projectx;

import com.bygoodtech.kings.common.dto.ApiResult;
import com.bygoodtech.kings.common.dto.page.PageInfo;
import com.kinghunt.misp.common.dto.projectx.ProjectTaskDTO;
import com.kinghunt.misp.common.param.projectx.ProjectTaskCondition;
import com.kinghunt.misp.common.param.projectx.ProjectTaskParam;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

/**
 * 任务管理
 *
 * @Author jiangtao
 * @Date 2025年3月7日
 */
@RestController
@RequestMapping("/api/projectx/task/")
public class ProjectTaskController {

    /**
     * 查看任务详情
     *
     * @param taskId
     * @return
     */
    @GetMapping("get")
    public ApiResult<ProjectTaskDTO> getTask(Long taskId) {

        return ApiResult.ok();
    }

    /**
     * 添加任务
     *
     * @param param
     * @return
     */
    @PostMapping(value = "add", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ApiResult<Long> addTask(@RequestBody ProjectTaskParam param) {

        return ApiResult.ok();
    }

    /**
     * 修改任务基础信息
     *
     * @param param
     * @return
     */
    @PostMapping(value = "update", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ApiResult<Long> updateSample(@RequestBody ProjectTaskParam param) {

        return ApiResult.ok();
    }

    /**
     * 搜索任务
     *
     * @param condition
     * @return
     */
    @GetMapping("search")
    public ApiResult<PageInfo<ProjectTaskDTO>> searchTask(ProjectTaskCondition condition) {

        return ApiResult.ok();
    }

    /**
     * 删除任务
     *
     * @param taskId
     * @return
     */
    @GetMapping("delete")
    public ApiResult<Void> deleteTask(Long taskId) {

        return ApiResult.ok();
    }

    /**
     * 开始任务
     *
     * @param taskId
     * @return
     */
    @GetMapping("start")
    public ApiResult<Void> startTask(Long taskId) {

        return ApiResult.ok();
    }

    /**
     * 结束任务
     *
     * @param taskId
     * @return
     */
    @GetMapping("end")
    public ApiResult<Void> endTask(Long taskId) {

        return ApiResult.ok();
    }
}
